package com.wenheng.service.impl;


import com.wenheng.Mapper.SeckillMapper;
import com.wenheng.Mapper.SeckillproductMapper;
import com.wenheng.service.SeckillService;
import com.wenheng.vo.entity.Seckill;
import com.wenheng.vo.entity.Seckillproduct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Auther: 文恒
 * @Date: 2021/3/24 - 03 - 24 -10:15
 * @Description:com.wenheng.service.impl
 * @version:1.0
 */
@Service
@Transactional
public class SeckillServiceImpl implements SeckillService {
    @Autowired
    private SeckillMapper seckillMapper;

    @Autowired
    private SeckillproductMapper seckillproductMapper;

    @Override
    public int saveBindingSeckillInfo(Seckillproduct seckillproduct) {
        return seckillproductMapper.insertSelective(seckillproduct);
    }

    @Override
    public int saveSeckillInfo(Seckill seckill) {
        return seckillMapper.insertSelective(seckill);
    }

    @Override
    public int updateSeckillcommodityNum(Seckill seckill) {
        return seckillMapper.updateByPrimaryKeySelective(seckill);
    }
}
